package com.example.demo.controller;


import com.example.demo.entity.User;
import com.example.demo.mapper.UserMapper;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController

public class UserListControllerB {

    @Autowired
    UserMapper userMapper;
    @RequestMapping("/listallb")
    public Page<User> getUserList(@RequestParam(value = "pageNum",defaultValue = "0")int pageNum,@RequestParam(value = "pageSize",defaultValue = "2")int pageSize){
        PageHelper.startPage(pageNum,pageSize);
        Page<User> userList=userMapper.getUserList();
        return userList;
    }
}
